<?php
	require_once 'UserService.class.php';
	//接收数据
	$username = $_POST['username'];
	$passwd = $_POST['password'];
	$email = $_POST['email'];

	$userServ = new UserService();
	$res = $userServ->addUser($username,$passwd,$email);
	if($res == 1){
		header("Location: friendList.php");
		session_start();
		$_SESSION['loginuser'] = $username;
		exit();
	}else{
		header("Location: login.php");
		exit();
	}